package com.fs.controller.vo.purchase;

import com.fs.service.bo.purchase.BoPurchaseWithRoomAndCustomer;
import com.fs.utils.Utils;
import lombok.Data;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
public class RespQueryPurchase {
    private Integer id;
    private float amount;
    private String beginDateTime;
    private String endDateTime;
    private Integer roomId;
    private String roomName;
    private String customerName;
    private String state;
    private String tradeNo;

    public RespQueryPurchase(BoPurchaseWithRoomAndCustomer bo) {
        this.id = bo.getId();
        this.amount = bo.getAmount();
        this.beginDateTime = Utils.localDateTimeToString(bo.getBeginTime());
        this.endDateTime = Utils.localDateTimeToString(bo.getEndTime());
        this.roomId = bo.getRoom().getId();
        this.roomName = bo.getRoom().getName();
        this.state = bo.getState().toString();
        this.customerName = bo.getCustomer().getName();
        this.tradeNo = bo.getTradeNo();
    }

}
